home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / mf / inputs / misc / xyline10.mf < prev    next >
Encoding:
Text File  |  1995-03-15  |  3.5 KB  |  109 lines

  1. % $Id: xyline10.mf,v 2.1 1992/01/02 14:54:07 kris Exp $ -*-tex-*-
  2. %
  3. % XYLINE10: line segments for XY mode at 10 point.
  4. % Copyright (c) 1991,1992  Kristoffer H. Rose  <kris@diku.dk>
  5. %
  6. % This file is part of the XY-pic macro package.
  7. %
  8. % The XY-pic macro package is free software; you can redistribute it and/or
  9. % modify it under the terms of the GNU General Public License as published by
  10. % the Free Software Foundation; either version 2 of the License, or (at your
  11. % option) any later version.
  12. %
  13. % The XY-pic macro package is distributed in the hope that it will be
  14. % useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
  16. % Public License for more details.
  17. %
  18. % You should have received a copy of the GNU General Public License along
  19. % with this macro package; if not, write to the Free Software Foundation, Inc.,
  20. % 675 Mass Ave, Cambridge, MA 02139, USA.
  21. %
  22. % CONTENTS: Line segments going either segl# down or to the right.  Codes
  23. % range from 0 to 127, distributed evenly in each of the
  24. % intervals between the `purely' horizontal/
  25. % vertical/diagonal characters with code 31,        ..../
  26. % 63, 95, and 127 (code -1 would be  pure as        :  /:
  27. % well if it existed):                    : /    :
  28. %                                                   :/    :
  29. %          ..../  ..../   |   o   o....  o....  o----  o...:
  30. %       :  /:  :  /:   |   |   :\  :  :\  :
  31. %       : / :  : / :   |   |   : \ :  : \ :
  32. %       :/  :  :/  :   |   |   :  \:  :  \:
  33. %       o...:  o...:   o   |   :...\  :...\
  34. %
  35. % Code: [-1]     0    30  31     63     64     95     127
  36. %
  37. font_identifier "XYLINE"; font_size 10pt#;
  38. font_coding_scheme:="XY line segments";
  39. mode_setup;
  40.  
  41. % METANESS...
  42. %
  43. segl# = 1/2 designsize; define_pixels(segl);    % line segment length
  44. rulew# = .4pt#; define_whole_blacker_pixels(rulew); % line thickness
  45. %
  46. % drawsegment draws a line from (0,0) to the argument point...
  47. def drawsegment expr endpoint =
  48.  z0 = (0,0); z1 = endpoint;
  49.  pickup pencircle scaled rulew rotated (angle (z1-z0) - 90);
  50.  draw z0--z1; penlabels(0,1) enddef;
  51.  
  52. % TESTING...we redefine openit because the characters extend far to the
  53. % left of the bounding box!
  54. %
  55. def openit = openwindow currentwindow
  56.  from origin to (screen_cols,screen_rows) at (-200,300) enddef;
  57.  
  58. % FONT.
  59. %
  60. % Font dimension 8 is the rule thickness (cf. The TeXbook, app.G)
  61. fontdimen 8: rulew#;
  62. %
  63. % The characters follow...
  64. %
  65. for cc = 0 step 1 until 30:
  66.  beginchar(cc,(31-cc)/32*segl#,segl#,0); drawsegment (w,h); endchar;
  67. endfor;
  68. %
  69. for cc = 31 step 1 until 63:
  70.  beginchar(cc,(cc-31)/32*segl#,0,segl#); drawsegment (w,-d); endchar;
  71. endfor;
  72. %
  73. for cc = 64 step 1 until 94:
  74.  beginchar(cc,segl#,0,(95-cc)/32*segl#); drawsegment (w,-d); endchar;
  75. endfor;
  76. %
  77. for cc = 95 step 1 until 126:
  78.  beginchar(cc,segl#,(cc-95)/32*segl#,0); drawsegment (w,h); endchar;
  79. endfor;
  80. %
  81. beginchar(127,segl#,segl#,0); drawsegment (w,h); endchar;
  82.  
  83. bye.
  84. %
  85. % $Log: xyline10.mf,v $
  86. % Revision 2.1  1992/01/02  14:54:07  kris
  87. % Release version.
  88. %
  89. % Revision 1.7  1991/12/17  04:51:16  kris
  90. % Version distributed with `final draft' on Usenet.
  91. %
  92. % Revision 1.6  1991/11/27  06:54:21  kris
  93. % \beta-test on DIKU.
  94. %
  95. % Revision 1.5  1991/10/21  23:19:08  kris
  96. % Version described in DIKU student report 91-7-10.
  97. %
  98. % Revision 1.4  1991/07/28  22:16:18  kris
  99. % Inverted char0..30 to avoid negative widths.
  100. %
  101. % Revision 1.3  1991/07/26  01:22:28  kris
  102. % Set bounding box completely!
  103. %
  104. % Revision 1.2  91/06/09  21:59:49  kris
  105. % separated METANESS and CHARACTERS
  106. %
  107. % Revision 1.1  91/06/06  22:52:31  kris
  108. % furst succesful attempt
  109.